// 配置主页路由
/* hidden 表示是否将此按钮显示 
  isAuth 表示该页面是否需要鉴权 
  title 表示当前页面的浏览器标题
  icon 表示当前按钮的图标 对应element-plus图标 
  isChildren 表示是否渲染当前子级的菜单
*/
const path = [
  {
    path: "test",
    component: () => import("../components/Test/index.vue"),
    hidden: false,
    meta: {
      isAuth: true,
      icon: "UserFilled",
      title: "测试",
    },
  },
  {
    path: "test1",
    component: () => import("../components/Test/index.vue"),
    hidden: false,
    meta: {
      isAuth: true,
      icon: "UserFilled",
      title: "测试1",
    },
  },
  {
    path: "test2",
    component: () => import("../components/Test/index.vue"),
    hidden: false,
    meta: {
      isAuth: true,
      icon: "UserFilled",
      title: "测试2",
    },
  },
];

export default [
  {
    path: "/",
    component: () => import("../components/Layout/index.vue"),
    hidden: false, // 是否显示
    redirect: "/test",
    meta: {
      isAuth: true, // 是否鉴权
      title: "主页",
    },
    children: path,
  },

  {
    path: "/login",
    name: "Login",
    component: () => import("../views/Login/index.vue"),
    hidden: false,
    meta: {
      icon: "UserFilled",
      title: "登录",
    },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("../components/404/index.vue"),
    hidden: false,
    meta: {
      title: "找不到当前页面",
    },
  },
  // 匹配所有以上不满足的页面
  {
    path: "/:pathMatch(.*)",
    redirect: "/404",
  },
];
